<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>xpcdemo.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">xpcdemo.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    <span class='nodesc'>No description.</span>
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/demos/xpc/xpcdemo.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">/goog/demos/xpc/xpcdemo.js</div>
    </div>
  </div>
<hr/>


   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.eventsMsgHandler_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">eventsMsgHandler_<span class="args">(<span class="arg">payload</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Handler for the 'events' service.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">payload</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The string returned from the xpcdemo.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line273">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.initCommon_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">initCommon_<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Initializes the demo.
Registers service-handlers and connects the channel.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line139">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.global.initInner"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.global.</span><span class="entryName">initInner<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Global function to kick off initialization in the iframe.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line50">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.initInner"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">initInner<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Initialization in the iframe.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line123">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.global.initOuter"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.global.</span><span class="entryName">initOuter<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Global function to kick off initialization in the containing document.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line42">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.initOuter"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">initOuter<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Initializes XPC in the containing page.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line58">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.log"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">log<span class="args">(<span class="arg">msgString</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Logging function. Inserts log-message into element with it id 'console'.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">msgString</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The log-message.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line183">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.mouseEventHandler_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">mouseEventHandler_<span class="args">(<span class="arg">e</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Function to be used as handler for mouse-events.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">e</span>
        : <span class="type"><a href="class_goog_events_BrowserEvent.html">goog.events.BrowserEvent</a></span>
        <div class="entryOverview">The mouse event.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line262">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.ping"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">ping<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Sends a ping request to the peer.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line194">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.pingHandler_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">pingHandler_<span class="args">(<span class="arg">payload</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       The handler function for incoming pings (messages sent to the service
called 'ping');

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">payload</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
        <div class="entryOverview">The message payload.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line206">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.sendN"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">sendN<span class="args">(<span class="arg">n</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Send multiple messages.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">n</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The number of messages to send.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line301">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.startMousemoveForwarding"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">startMousemoveForwarding<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Start mousemove event forwarding. Registers a listener on the document which
sends them over the channel.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line241">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.stopMousemoveForwarding"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">stopMousemoveForwarding<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Stop mousemove event forwarding.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line251">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="xpcdemo.teardown"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">xpcdemo.</span><span class="entryName">teardown<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Kills the peer iframe and the disposes the channel.

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line164">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>






  <h2>Global Variables</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="xpcdemo"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">xpcdemo</span>
        : 
     </div>


     <div class="entryOverview">
       Namespace for the demo. We don't use goog.provide here because it's not a
real module (cannot be required).

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_demos_xpc_xpcdemo.js.source.html#line36">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory xpc</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="/goog/demos/xpc/xpcdemo.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
